CREATE TABLE [dbo].[Contact]
(
[Oid] [uniqueidentifier] NOT NULL ROWGUIDCOL,
[WebPageAddress] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[NickName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SpouseName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TitleOfCourtesy] [int] NULL,
[Anniversary] [datetime] NULL,
[Notes] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Department] [uniqueidentifier] NULL,
[Manager] [uniqueidentifier] NULL,
[FirstNamel] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LastNamel] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Contact] ADD CONSTRAINT [PK_Contact] PRIMARY KEY CLUSTERED  ([Oid]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iDepartment_Contact] ON [dbo].[Contact] ([Department]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iManager_Contact] ON [dbo].[Contact] ([Manager]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Contact] WITH NOCHECK ADD CONSTRAINT [FK_Contact_Department] FOREIGN KEY ([Department]) REFERENCES [dbo].[Department] ([Oid]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[Contact] WITH NOCHECK ADD CONSTRAINT [FK_Contact_Manager] FOREIGN KEY ([Manager]) REFERENCES [dbo].[Contact] ([Oid]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[Contact] WITH NOCHECK ADD CONSTRAINT [FK_Contact_Oid] FOREIGN KEY ([Oid]) REFERENCES [dbo].[Person] ([Oid]) NOT FOR REPLICATION
GO
